package com.hengpeng.itfints.webcache;

import javax.servlet.http.HttpServletRequest;

/**
 * <pre>
 * 带url请求参数的页面缓存
 * </pre>
 * @author chenjian
 * @version 1.0, 2012-8-7
 */
public class WebPageEHCacheParamsFilter extends WebPageEHCacheFilter
{
	@Override
	protected String calculateKey(HttpServletRequest httpRequest)
	{
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append(httpRequest.getRequestURI());
		stringBuffer.append("_");
		stringBuffer.append(httpRequest.getServerName());
		String queryString = httpRequest.getQueryString();
		if (queryString != null)
		{
			stringBuffer.append("_");
			stringBuffer.append(queryString);
		}
		String key = stringBuffer.toString();
		return key;
	}
}
